﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;

namespace Acme.ShopStore.Shops
{
    public class ShopTypesAppService:ApplicationService,IShopTypesAppService
    {
        private readonly IRepository<Shop, Guid> _Shop;
        private readonly IRepository<ShopTypes, int> _ShopTypes;

        public ShopTypesAppService(IRepository<Shop, Guid> shops, IRepository<ShopTypes, int> shopTypes)
        {
            _Shop = shops;
            _ShopTypes = shopTypes;
        }

        public ShopDto State(int id)
        {
            throw new NotImplementedException();
        }

        public List<ShopDto> GetList(ShopQueryDto input)
        {
            var query = (from a in _Shop
                         join b in _ShopTypes
                         on a.ShopType equals b.Id
                         select new ShopDto()
                         {
                             Id = a.Id,
                             ShopType = b.Id,
                             ShopName = a.ShopName,
                             ShopImg = a.ShopImg,
                             ShopPrice = a.ShopPrice
                         }).ToList();
            return query;
        }

        //public PagedResultDto<ShopDto> GetList(ShopQueryDto input)
        //{
        //    throw new NotImplementedException();
        //}

        //public ShopDto State(int id)
        //{
        //    throw new NotImplementedException();
        //}
    }
}
